package net.findkrypton.event;

import javafx.scene.input.MouseButton;
import net.findkrypton.entity.TextStateBase;
import net.jumpengine.bean.Base;
import net.jumpengine.inter.IAction;

public class NumberBoxAction implements IAction {
	private HelpStateEvent event;

	public NumberBoxAction(HelpStateEvent helpStateEvent) {
		this.event=helpStateEvent;
	}

	@Override
	public void handle(int x, int y, MouseButton button, Base base) {
		TextStateBase box=(TextStateBase) base;
		Integer num=Integer.valueOf(box.getText());
		event.getLoopUpdateBase().setAble(false);
		event.getLoopUpdateBase().setLen(num-1);
		event.getNumBase().setText("∞");
	}

}
